#sing @echo off & SetLocal EnableDelayedExpansion & #newl cd /d "#ppthapps\mencoder"
#newl FOR /F "tokens=1,2 delims==" %%G IN ('mplayer.exe -identify -frames 0 -vo null -ao null  "#item" ') DO ( set %%G=%%H
#newl  IF %%G==ID_AUDIO_FORMAT IF %%H==85 (set info=NOT encode)  else  (set info=encode)  
#newl )
#newl echo #name#exte: !info!, length=!ID_LENGTH!sec, !ID_SEEKABLE!


<comment>
Click on Edit to open file in notepad. This tests if audio is mp3 (value 85). 
If ID_AUDIO_FORMAT is 85, variable info is set to 'NOT encode'. Else it is set to 'encode'.

-EnableDelayedExpansion is used, to enable changing values of the variable during 'for' loop.


-FOR /F "tokens=1,2 delims==" %%G IN ('mplayer.exe -identify -frames 0 -vo null -ao null  "#item" ') DO ( set %%G=%%H

-tokens=1,2 means use 1st and 2nd item in the text line
-Delimeter is second '='. If we wanted delimiter to be ';' we could write 'delims=;'. If we wanted ':' and or space we would use 'delims=; '
-type for /? in command line for more info on 'for' function in dos.

-output of 'mplayer.exe -identify -frames 0 -vo null -ao null  "#item" ' would be:
...
ID_AUDIO_FORMAT=85
ID_LENGTH=441,18
...

-set %%G=%%H:
-Same as if we write "set ID_AUDIO_FORMAT=85"
-it creates dos varialbe named ID_AUDIO_FORMAT, and set its value to 85.
-this so we can use !ID_AUDIO_FORMAT! and its value in the next lines.

-If you need case insensitive comparison, use "IF /I something=something_else"

-"() else ()", has to be in the same line with "if"
-"for" must be in the same line with "do ("
-you can use "LEQ" - less than or equal or "GEQ" - greater than or equal. Check if /? in command prompt.
	
-You can add "audio format=!ID_AUDIO_FORMAT!" to echo line, to see original audio format.
-It would also use variable name and value.


